﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TrigeToWin : MonoBehaviour {

    public delegate void SendPass(bool isPass);
    private SendPass sendPass;

    private void Start()
    {
        GameObject gameManager = GameObject.Find("GameManager");
        sendPass = new SendPass(gameManager.GetComponent<GameManager>().setIsPass);
    }

    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Player")
        {
            sendPass(true);
        }
    }
}
